import request from "./request";

// 获取作战任务列表
export const getTaskList = (form) => {
  return request({
    method: "GET",
    url: "/task/list",
    params: form,
  });
};

// 新增作战任务
export const SaveTask = (form) => {
  return request({
    method: "POST",
    url: "/task/save",
    data: form,
  });
};
// 查询任务详情
export const taskDetail = (form) => {
  return request({
    method: "GET",
    url: `/task/taskDetail`,
    params: form
  });
};
// 编辑作战任务
export const EditTask = (form) => {
  return request({
    method: "POST",
    url: "/task/edit",
    data: form,
  });
};

// 删除作战任务
export const deleteTask = (id) => {
  return request({
    method: "GET",
    url: `/task/delete/${id}`,
  });
};

// 获取能力分解树
export const getresolveTree = () => {
  return request({
    method: "GET",
    url: "/capacity/resolve/tree",
  });
};

// 保存能力分解
export const retention = (form) => {
  return request({
    method: "POST",
    url: `/capacity/resolve/save`,
    data: form,
  });
};

// 查询能力分解
export const queryCapability = (form) => {
  return request({
    method: "GET",
    url: `/capacity/resolve/list`,
    params: form,
  });
};

// 获取方案列表
export const getPlanList = (form) => {
  return request({
    method: "GET",
    url: "/plan/listPlan",
    params: form,
  });
};

// 获取能力
export const getresolvemenu = (form) => {
  return request({
    method: "GET",
    url: "/capacity/resolve/menu",
    params: form,
  });
};

// 获取装备
export const getequipmentmenu = (form) => {
  return request({
    method: "GET",
    url: "/equipment/menu",
    params: form,
  });
};
// 获取蓝方菜单装备
export const getblueequipmentmenu = () => {
  return request({
    method: "GET",
    url: "/equipment/blueMenu",
  });
};

// 获取红方菜单装备
export const getredequipmentmenu = () => {
  return request({
    method: "GET",
    url: "/equipment/redMenu",
  });
};

// 创建方案
export const planSave = (form) => {
  return request({
    method: "POST",
    url: `plan/save`,
    data: form,
  });
};

// 删除作战方案
export const planDelete = (form) => {
  return request({
    method: "GET",
    url: "/plan/delete",
    params: form,
  });
};

// 编辑作战方案
export const planEdit = (form) => {
  return request({
    method: "POST",
    url: `plan/edit`,
    data: form,
  });
};

// 查询作战方案详情
export const planDetail = (id) => {
  return request({
    method: "GET",
    url: `/plan/${id}`,
  });
};
// 查询推荐方案详情
export const recommendPlanDetail = (form) => {
  return request({
    method: "GET",
    url: `/plan/recommendPlan`,
    params: form,
  });
};

// 查询推荐方案详情
export const recommendScheme = (form) => {
  return request({
    method: "GET",
    url: `/plan/recommendPlan`,
    params: form,
  });
};

// 生成推荐方案
export const saveRecommendPlan = (form) => {
  return request({
    method: "GET",
    url: `/plan/saveRecommendPlan`,
    params: form,
  });
};

// 查询能力评估结果
export const getCapacityEvaluate = (form) => {
  return request({
    method: "GET",
    url: "/capacity/evaluate",
    params: form,
  });
};

// 能力评估结果详情
export const getCapacityPlan = (form) => {
  return request({
    method: "GET",
    url: "/capacity/plans",
    params: form,
  });
};
